<!-- 渠道预测 -->
<template>
  <div class="mainTable">
    <BaseTable :queryArr="queryArr" :baseDict="baseDict" :tableItems="tableItems" :updateItems="updateItems"
      :optionList="optionList" :methodParam="methodParam" :methodParam2="methodParam2" :Btn="Btn" :queryDict="queryDict"
      menuName="logRecord" pageName="mainTable" :placeholderDict="placeholderDict"/>
  </div>
</template>
<script>
import { service } from "../../../services/backServices";
import BaseTable from "../../table/doubleQueryPage.vue";
export default {
  name: "qdyc",
  data() {
    return {
      //后端人员修改-S
      //查询参数
      queryArr: [
        /////////第一次查询
        { prop: "predictObj", type: "select", placeholder: "请输入", value: "大促", name: "预测对象", show: true },
        { prop: "promotionSplitPopulBaseMonth", type: "month", placeholder: "请输入", value: "2023-12", name: "推广销售缺口补齐参考月份", show: true },
        //若选：大促
        { prop: "predictYear", type: "year", placeholder: "请输入", value: "2024", name: "预测大促年份", show: "大促" },
        { prop: "predictBigPromotionName", type: "select", placeholder: "请输入", value: "双十一", name: "预测大促名称", show: "大促" },
        //若选：月
        { prop: "predictMonth", type: "month", placeholder: "请输入", value: "2024-12", name: "预测月份", show: "月" },
        { prop: "overallBaseMonth", type: "month", placeholder: "请输入", value: "2023-11", name: "参考月份", show: "月" },

      ],
      placeholderDict: {
        tk_given_gmv:"非必填",
        living_given_gmv:"非必填"
      },
      // 英文转中文 
      baseDict: [
        { prop: "total_target_gmv", name: "生意目标" },
        { prop: "avg_trans_value", name: "客单价" },
        { prop: "total_gmv_r1", name: "生意目标达成预测值" },
        { prop: "tk_given_gmv", name: "淘客预计达成销售" },
        { prop: "living_given_gmv", name: "直播预计达成销售" },
        { prop: "ztc_given_fee", name: "直通车预计费用" },
        { prop: "ylmf_given_fee", name: "引力魔方预计费用" },
        { prop: "wxt_given_fee", name: "万相台预计费用" },
        { prop: "pxb_given_fee", name: "品销宝预计费用" },
        { prop: "his_tk_roi", name: "淘客roi历史值" },
        { prop: "predict_tk_roi", name: "淘客roi预测值" },
        { prop: "his_living_roi", name: "直播roi历史值" },
        { prop: "predict_living_roi", name: "直播roi预测值" },
        { prop: "his_ztc_roi", name: "直通车roi历史值" },
        { prop: "predict_ztc_roi", name: "直通车roi预测值" },
        { prop: "his_ylmf_roi", name: "引力魔方roi历史值" },
        { prop: "predict_ylmf_roi", name: "引力魔方roi预测值" },
        { prop: "his_wxt_roi", name: "万相台roi历史值" },
        { prop: "predict_wxt_roi", name: "万相台roi预测值" },
        { prop: "his_pxb_roi", name: "品销宝roi历史值" },
        { prop: "predict_pxb_roi", name: "品销宝roi预测值" },
        { prop: "his_effect_brand_adver_visit_buy_rate", name: "推广浏览转化率历史值" },
        { prop: "predict_effect_brand_adver_visit_buy_rate", name: "推广浏览转化率预测值" },
        { prop: "his_effect_brand_adver_collect_buy_rate", name: "推广收买率历史值" },
        { prop: "predict_effect_brand_adver_collect_buy_rate", name: "推广收买率预测值" },
        { prop: "his_effect_brand_adver_add_buy_rate", name: "推广加买率历史值" },
        { prop: "predict_effect_brand_adver_add_buy_rate", name: "推广加买率预测值" },
        { prop: "his_gmv_overlap_degree", name: "重合度预测历史值" },
        { prop: "predict_gmv_overlap_degree", name: "重合度预测值" },
        { prop: "his_tk_gmv_ratio_g1", name: "淘客销售占比历史值" },
        { prop: "predict_tk_gmv_ratio_g1", name: "淘客销售占比预测值" },
        { prop: "his_living_gmv_ratio_g1", name: "直播销售占比历史值" },
        { prop: "predict_living_gmv_ratio_g1", name: "直播销售占比预测值" },
        { prop: "his_promotion_gmv_ratio_g1", name: "推广销售占比历史值" },
        { prop: "predict_promotion_gmv_ratio_g1", name: "推广销售占比预测值" },
        { prop: "his_free_gmv_ratio_g1", name: "免费销售占比历史值" },
        { prop: "predict_free_gmv_ratio_g1", name: "免费销售占比预测值" },
        { prop: "his_promotion_of_promotion_free_ratio_g2", name: "推广的推广免费相对占比历史值" },
        { prop: "predict_promotion_of_promotion_free_ratio_g2", name: "推广的推广免费相对占比预测值" },
        { prop: "his_free_of_promotion_free_ratio_g2", name: "免费的推广免费相对占比历史值" },
        { prop: "predict_free_of_promotion_free_ratio_g2", name: "免费的推广免费相对占比预测值" },
      ],
      queryDict: {
        total_target_gmv: 32000000, avg_trans_value: 74, total_gmv_r1: 27404670,
        tk_given_gmv: 6500000, living_given_gmv: 4000000,
        ztc_given_fee: 770000, ylmf_given_fee: 190000, wxt_given_fee: 800000, pxb_given_fee: 420000,
        predict_tk_roi: 1.9, predict_living_roi: 3.0,
        predict_ztc_roi: 1.9, predict_ylmf_roi: 0.9, predict_wxt_roi: 2.7, predict_pxb_roi: 3.0,
        predict_effect_brand_adver_visit_buy_rate: 0.12, predict_effect_brand_adver_collect_buy_rate: 0.07, predict_effect_brand_adver_add_buy_rate: 0.45,
        predict_gmv_overlap_degree: 1.04,
        predict_tk_gmv_ratio_g1: 0.24, predict_living_gmv_ratio_g1: 0.17, predict_promotion_gmv_ratio_g1: 0.18, predict_free_gmv_ratio_g1: 0.45,
        predict_promotion_of_promotion_free_ratio_g2: 0.29, predict_free_of_promotion_free_ratio_g2: 0.71
      },
      //表格表头
      tableItems: null,

      //增删查改的对象属性
      updateItems: [//edit是回复
        { name: "文件名称", prop: "fileName", type: "input", disabled: true },
        { name: "上传类型", prop: "uploadType", type: "select" },
        { name: "备注", prop: "remark", type: "textarea" },
        { name: "上传文件", prop: "fileAdd", type: "upload" },
      ],
      //增删查改的对象属性的下拉select或者级联cascader
      optionList: {
        unit: [
          { label: "日", value: "日" },
          { label: "周", value: "周" },
          { label: "月", value: "月" },
          { label: "年", value: "年" },
        ],
        predictObj: [
          { label: "大促", value: "大促" },
          { label: "月", value: "月" },
        ],
        predictBigPromotionName: [
        {label:"双十一", value: "双十一"}
        ]
      },
      //增删查改方法参数
      methodParam: "getChannelPredictHisRes",
      methodParam2: "exportChannelPredictRes",
      // methodParam: "getHisData",
      // get_his_data(dffront1)；check_process_dffront2(dffront2, usedf)
      // dffront1是第一次交互需要输入的参数dataframe，dffront2是第二次交互需要输入的参数dataframe，usedf是第一次交互的部分结果dataframe（具体见py文件中如何调用方法的说明）

      //自定义btn功能
      Btn: {
        search: true, //查询按钮
        add: false, //添加按钮
        edit: false, //回复按钮
        detail: false, //详情按钮
        delete: false, //删除按钮
        deletes: false, //批量删除按钮
        export: true, //导出按钮
        templateDownload: false, //模板下载按钮
        upload: false, //上传按钮
      },
      //后端人员修改-E
    };
  },
  methods:{
    getBigPromotionList() {
      service({
        url: "getAllBigPromotionName",
        method: "post"
      }).then(res => {
        if(res.data.code == 200) {
          this.optionList.predictBigPromotionName = res.data.data.map(x => {
            return {
              label: x,
              value: x
            }
          })
        }
      })
    }
  },
  components: {
    BaseTable
  },
  created() {
    let _this = this
    this.getBigPromotionList()
  },
};
</script>
<style scoped lang="less">
.mainTable {
  background-color: #f1f2f9;
}
</style>